package com.bid.base.common.util.codec;


/**
 * <strong>Description : </strong> <br>
 * <p>
 * <strong>北京正源德标科技信息有限责任公司</strong> <br>
 * </p>
 * <br>
 *
 * @author : zhaots
 * @date Date : 2020年12月07日 18:22
 * 修改人 修改日期 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public class Digests
{
  private static final String KEY = "wKhebOESS0JkgjaY8ucifC2F";
  private static final byte[] IVPS = "9mLlxZts".getBytes();//Qar

  public static String encode(String src)
    throws CodecException
  {
    return Base64.encode(Desede.encode(src.getBytes(), "wKhebOESS0JkgjaY8ucifC2F", IVPS));
  }

  public static String decode(String src)
    throws CodecException
  {
    return new String(Desede.decode(Base64.decode(src), "wKhebOESS0JkgjaY8ucifC2F", IVPS));
  }

  public static void main(String[] args)
	{
		try {
			//
			// String encode = encode("123");
			// System.out.println(encode);
			String needDecodeStr="qo6mZU4vSvXlly32pb6bb/wvDkpjqW9OHW3nPVzwtuCx+ylJKgnRlMHVvchua7GU4tk56iUR0eBRGifgvQ0y/grasmy6lxe0tjUx5+K0gbzCT8O3sPNRdS0Ou1CNYP6tLwd+p7Ps7dSpzvdy1D/B88ldrerjnBzu0TOQZLCiaRy5NdPspr130w3bSN0gNtoNHjTbmDDTjzlssm+h27Dj4ZnzI7+p0ka6";
			System.out.println(decode(needDecodeStr));
//			System.out.println(decode("fSsvTgQLQyo="));
		} catch (CodecException e) {
			e.printStackTrace();
		}
	}
}